#ifndef _ENGINE_H_
#define _ENGINE_H_

#define DEFAULT_FIFO_SIZE (256 * 1024)

#define ENGINE_MODE_2D 0
#define ENGINE_MODE_3D 1

#include "Scene.h"

#include <gccore.h>
#include <string.h>
#include <malloc.h>

class Engine {
public:
	Engine();
	~Engine();
	void Init();
	void MainLoop();
	void Update();
	void StartDrawing();
	void EndDrawing();
	void Render();

	void SetRenderMode(int _render_mode);
	void SetScene(Scene* _scene);
	int GetRenderMode();
	Scene* GetScene();

protected:
	void InitVideo();
	void InitGX();

private:
	int render_mode;
	Scene *scene;

	//Low Level Video
	void *frameBuffer[2];
	GXRModeObj *rmode;
	u32	fb, xfbHeight;
	f32 yscale;
	
	//GX Settings
	GXColor background;
	Mtx44 projectionMtx;

public:
	static Mtx GX_ModelViewMtx;
};

#endif // _ENGINE_H_